// SampleSetup.cpp : Defines the entry point for the DLL application.
//

#include "windows.h"
#include "setup.h"

#pragma comment(linker, "/nodefaultlib:libc.lib")
#pragma comment(linker, "/nodefaultlib:libcd.lib")

#define INSTALL_INIT_EVENT_NAME (_T("INSTALL_INIT_EVENT_NAME"))
#define INSTALL_EXIT_EVENT_NAME (_T("INSTALL_EXIT_EVENT_NAME"))

BOOL APIENTRY DllMain( HANDLE hModule, 
                       DWORD  ul_reason_for_call, 
                       LPVOID lpReserved
					 )
{
    return TRUE;
}

codeINSTALL_INIT
Install_Init(
    HWND        hwndParent,
    BOOL        fFirstCall,     // is this the first time this function is being called?
    BOOL        fPreviouslyInstalled,
    LPCTSTR     pszInstallDir
)
{
	HANDLE hEvent = CreateEvent(NULL, FALSE, FALSE, INSTALL_INIT_EVENT_NAME);
	SetEvent(hEvent);
	CloseHandle(hEvent);

	return codeINSTALL_INIT_CONTINUE;
}


codeINSTALL_EXIT
Install_Exit(
    HWND    hwndParent,
    LPCTSTR pszInstallDir,
    WORD    cFailedDirs,
    WORD    cFailedFiles,
    WORD    cFailedRegKeys,
    WORD    cFailedRegVals,
    WORD    cFailedShortcuts
)
{
	HANDLE hEvent = CreateEvent(NULL, FALSE, FALSE, INSTALL_EXIT_EVENT_NAME);
	SetEvent(hEvent);
	CloseHandle(hEvent);

	return codeINSTALL_EXIT_DONE;
}

codeUNINSTALL_INIT
Uninstall_Init(
    HWND        hwndParent,
    LPCTSTR     pszInstallDir
)
{
	return codeUNINSTALL_INIT_CONTINUE;
}


codeUNINSTALL_EXIT
Uninstall_Exit(
    HWND    hwndParent
)
{
	return codeUNINSTALL_EXIT_DONE;
}